package Accessors;

import Callbacks.AbstractCallback;
import Models.POSSupplyView;
import Presenter.POSSupplyViewPresenter;
import android.app.ProgressDialog;
import android.content.Context;

@SuppressWarnings("rawtypes")
public class POSSupplyViewAccessor extends AbstractAccessor<POSSupplyView,POSSupplyViewPresenter,AbstractCallback> {
	private final String NAME = "possupplyview";
	private final String DIALOG = "Supply Item(s)";
	
	private final static POSSupplyViewPresenter presenter = new POSSupplyViewPresenter();
	
	//Modal dialog variable.
	ProgressDialog modalDialog = null;
	
	public POSSupplyViewAccessor(AbstractCallback callback){
		super(presenter, callback);
	}
	
	//Public access functions.
	public void getAllItems(final Context context){
		String dialog = "Loading " + DIALOG + " List...";
		String rfString = NAME + "/runNamedQuery/POSSupplyView.findAll";
		super.getAllItems(context, dialog, rfString);
	}
	
	//Public access functions.
	public void getAllSAFItems(final Context context){
		String dialog = "Loading " + DIALOG + " List...";
		String rfString = NAME + "/runNamedQuery/POSSupplyView.findAllSAF";
		super.getAllItems(context, dialog, rfString);
	}
	
	public void getItem(final int id, final Context context){
		String dialog = "Loading " + DIALOG + "...";
		String rfString = NAME + "/" + Integer.toString(id);
		super.getItem(context, dialog, rfString);
	}
	
	public void doItemUpdate(final POSSupplyView item, final Context context){
		String dialog = "Updating " + DIALOG + "...";
		String rfString = NAME;
		super.doItemUpdate(item, context, dialog, rfString);
	}
	
	public void doItemInsert(final POSSupplyView item, final Context context){
		String dialog = "Inserting " + DIALOG + "...";
		String rfString = NAME;
		super.doItemInsert(item, context, dialog, rfString);
	}
}
